/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simple.framework.util;

import org.json.*;

/**
 *
 * @author cxc
 */
public class json {

    public static JSONObject stringToJSONObject(String JSONStr) {
        String str1 = JSONStr;
        JSONObject reObject1 = new JSONObject();
        try {
            reObject1 = new JSONObject(str1);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return reObject1;
    }

     public static Object getSafeJSONObjectValue(JSONObject jsonObject, String key) {
        Object tObject = "";
        JSONObject localObject1 = jsonObject;
        String str1 = key;
        try {
            tObject = localObject1.get(str1);
        } catch (JSONException e) {
           //e.printStackTrace();
        }
        return tObject;
    }
}
